package com.newer.procurementsystem.controller;

import com.newer.procurementsystem.model.Department;
import com.newer.procurementsystem.model.DepartmentExample;
import com.newer.procurementsystem.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptController {
    @Autowired
    private DepartmentService deptService;

    @RequestMapping("/selectDeptAll")
    public List<Department> selectDeptAll(){
        DepartmentExample example = new DepartmentExample();
        List<Department> depts = deptService.selectByExample(example);
        return depts;
    }
}
